package com.aiprompt.demos.mapper;

import com.aiprompt.demos.model.domain.Dict;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
* @author Administrator
* @description 针对表【dict(提示词模板表)】的数据库操作Mapper
* @createDate 2025-08-27 16:48:28
* @Entity com.aiprompt.demos.model.domain.Dict
*/
public interface DictMapper extends BaseMapper<Dict> {

    @Update("CREATE TABLE IF NOT EXISTS `dict` (" +
            "`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键'," +
            "`title` varchar(256) NOT NULL COMMENT '模板名称'," +
            "`description` varchar(512) DEFAULT NULL COMMENT '模板描述'," +
            "`category` varchar(100) DEFAULT NULL COMMENT '模板分类'," +
            "`tags` varchar(512) DEFAULT NULL COMMENT '模板标签'," +
            "`content` text NOT NULL COMMENT '模板内容'," +
            "`templateKeys` varchar(512) DEFAULT NULL COMMENT '替换关键词'," +
            "`createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'," +
            "`updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'," +
            "`isDelete` tinyint NOT NULL DEFAULT 0 COMMENT '是否删除：0-未删除，1-已删除'," +
            "PRIMARY KEY (`id`)," +
            "KEY `idx_category` (`category`)," +
            "KEY `idx_createTime` (`createTime`)" +
            ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提示词模板表'")
    void createDictTable();

}




